package ch.qos.logback.classic.net;

import lombok.Data;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author zhangweilin
 * @description: 异步发异常邮件
 * @date 2018/6/8
 */
@Data
public class RunnableSendEmailTask implements Runnable {
    protected Log loger = LogFactory.getLog(this.getClass());
    private HlSMTPAppender hlSMTPAppender;

    public RunnableSendEmailTask(HlSMTPAppender hlSMTPAppender) {
        this.hlSMTPAppender = hlSMTPAppender;
    }

    @Override
    public void run() {
//        loger.info("当前线程【"+Thread.currentThread().getName()+"】，执行发送邮件开始");
        hlSMTPAppender.sendBufferEmail();
//        loger.info("当前线程【"+Thread.currentThread().getName()+"】，执行发送邮件完毕");
    }
}
